package com.springframework.cloud.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import sun.misc.Contended;

//@Configuration
//public class GatewayConfig {
//
//    /**
//     * 使用编码方式配置网关路由
//     * @param builder  这里构建了,配置文件中就可以不用配置了
//     * @return
//     */
//    @Bean
//    public RouteLocator customRouterLocator(RouteLocatorBuilder builder){
//        return builder.routes()
//                .route("user_route",r->r.path("/users/**").uri("http://localhost:9999/"))
//                .route("commodities_route",r->r.path("/commodities/**").uri("http://localhost:9998/"))
//                .build();
//
//    }
//}
